import {ComponentType} from 'react'
import Taro, {Component, Config} from '@tarojs/taro'
import {View, Button, Text, Swiper, SwiperItem, Image} from '@tarojs/components'



import './cashSuccess.scss'

import icon_08 from '../../assets/img/icon_01.png'
import { makePhoneCall, navigateTo, servicePhone, getStorage} from "../../utils/common";

class CashSuccess extends Component {
  componentWillMount() {
    Taro.setNavigationBarTitle({title: '申请成功'})
  }

  makePhone() {
    makePhoneCall(servicePhone)
  }

  link(url: string = '/pages/index/index'): void {
    navigateTo(url)
  }

  render() {
    let cashInfo = getStorage('cashInfo') || {}
    return (
      <View>
          <View className='pay-success page-bg content-20'>
              <View className='success-header'>
                  <Image className='success-header__icon' src={icon_08} />
                  <View className='success-header__title'>提现申请成功</View>
                  <View className='desc'>我们会尽快为您提现, 请耐心等待</View>
              </View>

              <View className='line-common__wrap'>
                  <View className='line-common'>
                      <View className='line-common__title'>提现金额</View>
                      <View className='line-common__con yuan'>{cashInfo.cashAmount}</View>
                  </View>
                  <View className='line-common'>
                      <View className='line-common__title'>提现方式</View>
                      <View className='line-common__con'>{cashInfo.cashType}</View>
                  </View>
                  <View className='line-common'>
                      <View className='line-common__title'>提现银行</View>
                      <View className='line-common__con '>{cashInfo.cashBank}</View>
                  </View>
              </View>

              <View className='btn-two-wrap'>
                  <View className='btn-two-wrap__btn btn-two-wrap__active' style={{width: '100px'}} onClick={this.link.bind(this, '/pages/mine/mine')}>确定</View>
              </View>
          </View>
      </View>

    )
  }
}

export default CashSuccess
